<?php

	// +----------------------------------------------------------------------
	// | APP用户
	// +----------------------------------------------------------------------
	// | Copyright (c) 2015-2024 http://www.yicmf.com, All rights reserved.
	// +----------------------------------------------------------------------
	// | Author: 微尘 <yicmf@qq.com>
	// +----------------------------------------------------------------------

	namespace app\model\app;

	use app\common\model\Pivot;
	use app\model\ucenter\User;
    use think\model\concern\SoftDelete;

    class DeviceUser extends Pivot
	{


        use SoftDelete;
        protected $name = 'app_device_user';
		public function user()
		{
			return $this->belongsTo(User::class);
		}

		public function device()
		{
			return $this->belongsTo(Device::class);
		}

		/**
		 * 写入修改
		 * @param $data
		 */
		public static function onBeforeInsert($data)
		{
			$data['status'] = 1;
		}



	}
